@extends('home.inc.common')
@section('title')
    <title>{{$cate_info->cate_name}}好文 - 奇异果聚合</title>
    <meta name="keywords" content="{{$cate_info->seo_key}}" />
    <meta name="description" content="{{$cate_info->seo_intro}}" />
    <link href="{{asset('home_new/css/libs.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('home_new/css/global.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('home_new/css/page2.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('home_new/css/page.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('home_new/css/qyg2016.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('home/js/skin/layer.css')}}" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="{{asset('home/js/jquery-3.1.0.min.js')}}"></script>
    <script type="text/javascript" src="{{asset('pulgin/layer/layer.js')}}"></script>
    <style>
        body{
            background: url({{asset('home_new/images/img_75f5025a_stars_bg.png')}})
        }

    </style>
@endsection
@section('content')
    <div class="wrap">
        <div id="main" style="background:none;">
            @include('home.inc.article_category')
            <div id="main_plusArt" style="padding-top:100px;">
                <!-- 栏目文章调用 -->
                <div class="plus_article" style="margin:0 auto 30px;">
                            <div class="index_title clear">
                                <div class="index_titleMain">
                                        <h1 style="color: #fff">{{$cate_info->cate_name}}</h1>
                                </div>
                            </div>
                            <div class="art_wrap clear">
                                <ul class="art_list clear" style="width:1140px;">
                                    @foreach($archives as $archive)
                                        <li class="article_item article_item{{$archive->index}}" style="margin-bottom: 20px;">
                                            <a class="global_gaNode" href="{{route('article.show', [$archive->id])}}" target="_blank">
                                                <div class="img_box">
                                                    <img src="{{route('image', [trim($archive->cover, '/'), '265x155'])}}"/>
                                                    <div class="plus_article_cover">
                                                    </div>
                                                </div>
                                                <h3 class="article_title yellow_line" title="{{$archive->title}}">
                                                    {{mb_substr($archive->title,0,23)}}
                                                </h3>
                                                <p class="article_content">
                                                    {{mb_substr($archive->abstract,0,70)}}
                                                </p>
                                        <span class="article_total index_icons">
                                            {{$archive->visit_count}}
                                        </span>
                                            </a>
                                        </li>
                                    @endforeach

                                </ul>
                            </div>
                </div>

                <!-- 栏目文章调用 -->
                                    <div class="wrap_go">
                                        <span style="right: 160px;"></span>
                                        <a href="javascript:;" id="get_more">加载更多</a>
                                    </div>
            </div>
        </div>
    </div>
    <script>
        $(function(){
            var page = 0;
            $("#get_more").click(function(){
                var cate_id = "{{$cate_info->cate_id}}";
                var token = "{{csrf_token()}}";
                $.ajax({
                    url:"{{url('article/more')}}",
                    type:"post",
                    data:{cate_id:cate_id,_token:token,page:page},
                    success:function(data){
                        if(data.length==0){
                            layer.msg('没有更多了！');
                        }else {
                            for(var i=0;i<data.length;i++){
                                $('.recom_list').append(
                                        '<li class="recom_item0">' +
                                        '<a class="global_gaNode" href="'+data[i].url+'" target="_blank">' +
                                        '<img src="'+data[i].img+'">' +
                                        '<div class="plus_cover plus_coverBottom">' +
                                        '</div>' +
                                        '</a>' +
                                        '<a class="global_gaNode" href="'+data[i].url+'" target="_blank">' +
                                        '<h3 class="recom_title">' + data[i].title +
                                        '</h3>' +
                                        '</a>' +
                                        '<span class="recom_total index_icons">' + data[i].visit_count +
                                        '</span>' +
                                        '</li>');
                            }
                            page += 1;
                        }
                    }
                });
            });
        });
    </script>
@endsection